# eric7.Plugins.VcsPlugins.vcsMercurial.hg

Module implementing the version control systems interface to Mercurial.

### Global Attributes

None

### Classes

Hg | Class implementing the version control systems interface to Mercurial.

### Functions

None

## Hg

Class implementing the version control systems interface to Mercurial.

### Signals

activeExtensionsChanged()
  emitted when the list of active extensions has changed
committed()
  emitted after the commit action has completed
iniFileChanged()
  emitted when a Mercurial/repo configuration file has changed

### Derived from

VersionControl

### Class Attributes

IgnoreFileName

### Class Methods

None

### Methods

Hg | Constructor
__checkDefaults | Private method to check, if the default and default-push URLs have been configured.
__createClient | Private method to create a Mercurial command server client.
__getExtensionsInfo | Private method to get the active extensions from Mercurial.
__getInOutBookmarks | Private method to get the list of incoming or outgoing bookmarks.
__getMostRecentCommitMessage | Private method to get the most recent commit message.
__hgGetFileForRevision | Private method to get a file for a specific revision from the repository.
__hgGraftSubCommand | Private method to perform a Mercurial graft subcommand.
__iniFileChanged | Private slot to handle a change of the Mercurial configuration file.
__monitorRepoConfigFiles | Private slot to add some repository configuration files to the list of monitored files.
__vcsCommit_Step2 | Private slot performing the second step of the commit action.
_createStatusMonitorThread | Protected method to create an instance of the VCS status monitor thread.
canCommitMerge | Public method to check, if the working directory is an uncommitted merge.
canPull | Public method to check, if pull is possible.
canPush | Public method to check, if push is possible.
clearStatusCache | Public method to clear the status cache.
getBuiltinObject | Public method to get a reference to a builtins object.
getClient | Public method to get a reference to the command server interface.
getEncoding | Public method to get the encoding to be used by Mercurial.
getExtensionObject | Public method to get a reference to an extension object.
getHgSubPath | Public method to get the path to the .hgsub file containing the definitions of sub-repositories.
getPlugin | Public method to get a reference to the plugin object.
hasSubrepositories | Public method to check, if the project might have sub-repositories.
hgAbortMerge | Public method to abort an uncommitted merge.
hgAddSubrepository | Public method to add a sub-repository.
hgAnnotate | Public method to show the output of the hg annotate command.
hgArchive | Public method to create an unversioned archive from the repository.
hgBackout | Public method used to backout an earlier changeset from the Mercurial repository.
hgBisect | Public method to perform bisect commands.
hgBookmarkDefine | Public method to define a bookmark.
hgBookmarkDelete | Public method to delete a bookmark.
hgBookmarkIncoming | Public method to show a list of incoming bookmarks.
hgBookmarkMove | Public method to move a bookmark.
hgBookmarkOutgoing | Public method to show a list of outgoing bookmarks.
hgBookmarkPull | Public method to pull a bookmark from a remote repository.
hgBookmarkPush | Public method to push a bookmark to a remote repository.
hgBookmarkRename | Public method to rename a bookmark.
hgBranch | Public method used to create a branch in the Mercurial repository.
hgBundle | Public method to create a changegroup file.
hgConflicts | Public method used to show a list of files containing conflicts.
hgCopy | Public method used to copy a file/directory.
hgCreateIgnoreFile | Public method to create the ignore file.
hgDeleteBackups | Public method to delete all backup bundles in the backup area.
hgEditConfig | Public method used to edit the repository configuration file.
hgEditUserConfig | Public method used to edit the user configuration file.
hgExport | Public method to export patches to files.
hgExtendedDiff | Public method used to view the difference of a file/directory to the Mercurial repository.
hgGetBookmarksList | Public method to get the list of bookmarks.
hgGetBranchesList | Public method to get the list of branches.
hgGetCurrentBranch | Public method to get the current branch of the working directory.
hgGetTagsList | Public method to get the list of tags.
hgGraft | Public method to copy changesets from another branch.
hgGraftAbort | Public method to abort an interrupted copying session and perform a rollback.
hgGraftContinue | Public method to continue copying changesets from another branch.
hgGraftStop | Public method to stop an interrupted copying session.
hgIdentify | Public method to identify the current working directory.
hgImport | Public method to import a patch file.
hgIncoming | Public method used to view the log of incoming changes from the Mercurial repository.
hgInfo | Public method to show information about the heads of the repository.
hgListBookmarks | Public method used to list the available bookmarks.
hgListTagBranch | Public method used to list the available tags or branches.
hgNormalizeURL | Public method to normalize a url for Mercurial.
hgOutgoing | Public method used to view the log of outgoing changes from the Mercurial repository.
hgPhase | Public method to change the phase of revisions.
hgPreviewBundle | Public method used to view the log of incoming changes from a changegroup file.
hgPull | Public method used to pull changes from a remote Mercurial repository.
hgPush | Public method used to push changes to a remote Mercurial repository.
hgReMerge | Public method used to merge a URL/revision into the local project.
hgRecover | Public method to recover an interrupted transaction.
hgRemoveSubrepositories | Public method to remove sub-repositories.
hgRollback | Public method used to rollback the last transaction.
hgServe | Public method used to serve the project.
hgShowBranch | Public method used to show the current branch of the working directory.
hgShowConfig | Public method to show the combined configuration.
hgShowPaths | Public method to show the path aliases for remote repositories.
hgSummary | Public method used to show some summary information of the working directory state.
hgUnbundle | Public method to apply changegroup files.
hgVerify | Public method to verify the integrity of the repository.
initCommand | Public method to initialize a command arguments list.
isExtensionActive | Public method to check, if an extension is active.
stopClient | Public method to stop the command server client.
vcsAdd | Public method used to add a file/directory to the Mercurial repository.
vcsAddBinary | Public method used to add a file/directory in binary mode to the Mercurial repository.
vcsAddCommitMessage | Public method to add a commit message to the list of saved messages.
vcsAddTree | Public method to add a directory tree rooted at path to the Mercurial repository.
vcsAllRegisteredStates | Public method used to get the registered states of a number of files in the vcs.
vcsCheckout | Public method used to check the project out of a Mercurial repository (clone).
vcsCleanup | Public method used to cleanup the working directory.
vcsClearCommitMessages | Public method to clear the list of saved messages.
vcsCommandLine | Public method used to execute arbitrary mercurial commands.
vcsCommit | Public method used to make the change of a file/directory permanent in the Mercurial repository.
vcsCommitMessages | Public method to get the list of saved commit messages.
vcsConvertProject | Public method to convert an uncontrolled project to a version controlled project.
vcsDiff | Public method used to view the difference of a file/directory to the Mercurial repository.
vcsExists | Public method used to test for the presence of the hg executable.
vcsExport | Public method used to export a directory from the Mercurial repository.
vcsForget | Public method used to remove a file from the Mercurial repository.
vcsGetProjectBrowserHelper | Public method to instantiate a helper object for the different project browsers.
vcsGetProjectHelper | Public method to instantiate a helper object for the project.
vcsImport | Public method used to import the project into the Mercurial repository.
vcsInit | Public method used to initialize the mercurial repository.
vcsInitConfig | Public method to initialize the VCS configuration.
vcsLogBrowser | Public method used to browse the log of a file/directory from the Mercurial repository.
vcsMerge | Public method used to merge a URL/revision into the local project.
vcsMove | Public method used to move a file/directory.
vcsName | Public method returning the name of the vcs.
vcsNewProjectOptionsDialog | Public method to get a dialog to enter repository info for getting a new project.
vcsOptionsDialog | Public method to get a dialog to enter repository info.
vcsRegisteredState | Public method used to get the registered state of a file in the vcs.
vcsRemove | Public method used to remove a file/directory from the Mercurial repository.
vcsRepositoryInfos | Public method to retrieve information about the repository.
vcsResolved | Public method used to resolve conflicts of a file/directory.
vcsRevert | Public method used to revert changes made to a file/directory.
vcsSbsDiff | Public method used to view the difference of a file to the Mercurial repository side-by-side.
vcsShutdown | Public method used to shutdown the Mercurial interface.
vcsStatus | Public method used to view the status of files/directories in the Mercurial repository.
vcsSupportCommandOptions | Public method to signal the support of user settable command options.
vcsSwitch | Public method used to switch a working directory to a different revision.
vcsTag | Public method used to set/remove a tag in the Mercurial repository.
vcsUpdate | Public method used to update a file/directory with the Mercurial repository.

### Static Methods

None

#### Hg (Constructor)

Hg(plugin, parent=None, name=None)

Constructor

plugin (VcsMercurialPlugin)
  reference to the plugin object
parent (QWidget)
  parent widget
name (str)
  name of this object

#### Hg.__checkDefaults

__checkDefaults()

Private method to check, if the default and default-push URLs have been configured.

#### Hg.__createClient

__createClient(repodir="")

Private method to create a Mercurial command server client.

repodir (str)
  path of the local repository

#### Hg.__getExtensionsInfo

__getExtensionsInfo()

Private method to get the active extensions from Mercurial.

#### Hg.__getInOutBookmarks

__getInOutBookmarks(incoming)

Private method to get the list of incoming or outgoing bookmarks.

incoming (bool)
  flag indicating to get incoming bookmarks

Return:
  list of bookmarks

Return Type:
  list of str

#### Hg.__getMostRecentCommitMessage

__getMostRecentCommitMessage()

Private method to get the most recent commit message.

Note: This message is extracted from the parent commit of the working directory.

Return:
  most recent commit message

Return Type:
  str

#### Hg.__hgGetFileForRevision

__hgGetFileForRevision(name, rev="")

Private method to get a file for a specific revision from the repository.

name (str)
  file name to get from the repository
rev (str)
  revision to retrieve

Return:
  contents of the file (string) and an error message

Return Type:
  str

#### Hg.__hgGraftSubCommand

__hgGraftSubCommand(subcommand, title)

Private method to perform a Mercurial graft subcommand.

subcommand (str)
  subcommand flag
title (str)
  tirle of the dialog

Return:
  flag indicating that the project should be reread

Return Type:
  bool

#### Hg.__iniFileChanged

__iniFileChanged(path)

Private slot to handle a change of the Mercurial configuration file.

path (str)
  name of the changed file

#### Hg.__monitorRepoConfigFiles

__monitorRepoConfigFiles(repodir)

Private slot to add some repository configuration files to the list of monitored files.

repodir (str)
  directory name of the repository

#### Hg.__vcsCommit_Step2

__vcsCommit_Step2()

Private slot performing the second step of the commit action.

#### Hg._createStatusMonitorThread

_createStatusMonitorThread(interval, project)

Protected method to create an instance of the VCS status monitor thread.

interval (int)
  check interval for the monitor thread in seconds
project (Project)
  reference to the project object

Return:
  reference to the monitor thread

Return Type:
  HgStatusMonitorThread

#### Hg.canCommitMerge

canCommitMerge()

Public method to check, if the working directory is an uncommitted merge.

Return:
  flag indicating commit merge capability

Return Type:
  bool

#### Hg.canPull

canPull()

Public method to check, if pull is possible.

Return:
  flag indicating pull capability

Return Type:
  bool

#### Hg.canPush

canPush()

Public method to check, if push is possible.

Return:
  flag indicating push capability

Return Type:
  bool

#### Hg.clearStatusCache

clearStatusCache()

Public method to clear the status cache.

#### Hg.getBuiltinObject

getBuiltinObject(builtinName)

Public method to get a reference to a builtins object.

builtinName (str)
  name of the builtin

Return:
  reference to the builtin object

Return Type:
  bool

#### Hg.getClient

getClient()

Public method to get a reference to the command server interface.

Return:
  reference to the client

Return Type:
  HgClient

#### Hg.getEncoding

getEncoding()

Public method to get the encoding to be used by Mercurial.

Return:
  encoding

Return Type:
  str

#### Hg.getExtensionObject

getExtensionObject(extensionName)

Public method to get a reference to an extension object.

extensionName (str)
  name of the extension

Return:
  reference to the extension object

Return Type:
  bool

#### Hg.getHgSubPath

getHgSubPath()

Public method to get the path to the .hgsub file containing the definitions of sub-repositories.

Return:
  full path of the .hgsub file

Return Type:
  str

#### Hg.getPlugin

getPlugin()

Public method to get a reference to the plugin object.

Return:
  reference to the plugin object

Return Type:
  VcsMercurialPlugin

#### Hg.hasSubrepositories

hasSubrepositories()

Public method to check, if the project might have sub-repositories.

Return:
  flag indicating the existence of sub-repositories

Return Type:
  bool

#### Hg.hgAbortMerge

hgAbortMerge()

Public method to abort an uncommitted merge.

Return:
  flag indicating, that the abortion contained an add or delete

Return Type:
  bool

#### Hg.hgAddSubrepository

hgAddSubrepository()

Public method to add a sub-repository.

#### Hg.hgAnnotate

hgAnnotate(name, skiplist="")

Public method to show the output of the hg annotate command.

name (str)
  file name to show the annotations for
skiplist (str)
  name of a skip list file

#### Hg.hgArchive

hgArchive()

Public method to create an unversioned archive from the repository.

#### Hg.hgBackout

hgBackout()

Public method used to backout an earlier changeset from the Mercurial repository.

#### Hg.hgBisect

hgBisect(subcommand)

Public method to perform bisect commands.

subcommand (str)
  name of the subcommand (one of 'good', 'bad', 'skip' or 'reset')

Raises ValueError:
  raised to indicate an invalid bisect subcommand

#### Hg.hgBookmarkDefine

hgBookmarkDefine(revision=None, bookmark=None)

Public method to define a bookmark.

revision (str)
  revision to set bookmark for
bookmark (str)
  name of the bookmark

#### Hg.hgBookmarkDelete

hgBookmarkDelete(bookmark=None)

Public method to delete a bookmark.

bookmark (str)
  name of the bookmark

#### Hg.hgBookmarkIncoming

hgBookmarkIncoming()

Public method to show a list of incoming bookmarks.

#### Hg.hgBookmarkMove

hgBookmarkMove(revision=None, bookmark=None)

Public method to move a bookmark.

revision (str)
  revision to set bookmark for
bookmark (str)
  name of the bookmark

#### Hg.hgBookmarkOutgoing

hgBookmarkOutgoing()

Public method to show a list of outgoing bookmarks.

#### Hg.hgBookmarkPull

hgBookmarkPull(current=False, bookmark=None)

Public method to pull a bookmark from a remote repository.

current (bool)
  flag indicating to pull the current bookmark
bookmark (str)
  name of the bookmark

#### Hg.hgBookmarkPush

hgBookmarkPush(current=False, bookmark=None, allBookmarks=False)

Public method to push a bookmark to a remote repository.

current (bool)
  flag indicating to push the current bookmark
bookmark (str)
  name of the bookmark
allBookmarks (bool)
  flag indicating to push all bookmarks

#### Hg.hgBookmarkRename

hgBookmarkRename(renameInfo=None)

Public method to rename a bookmark.

renameInfo (tuple of str and str)
  old and new names of the bookmark

#### Hg.hgBranch

hgBranch()

Public method used to create a branch in the Mercurial repository.

#### Hg.hgBundle

hgBundle(bundleData=None)

Public method to create a changegroup file.

bundleData (dict)
  dictionary containing the bundle creation information

#### Hg.hgConflicts

hgConflicts()

Public method used to show a list of files containing conflicts.

#### Hg.hgCopy

hgCopy(name, project)

Public method used to copy a file/directory.

name (str)
  file/directory name to be copied
project (Project)
  reference to the project object

Return:
  flag indicating successful operation

Return Type:
  bool

#### Hg.hgCreateIgnoreFile

hgCreateIgnoreFile(name, autoAdd=False)

Public method to create the ignore file.

name (str)
  directory name to create the ignore file in
autoAdd (bool)
  flag indicating to add it automatically

Return:
  flag indicating success

Return Type:
  bool

#### Hg.hgDeleteBackups

hgDeleteBackups()

Public method to delete all backup bundles in the backup area.

#### Hg.hgEditConfig

hgEditConfig(repoName=None, withLargefiles=True, largefilesData=None)

Public method used to edit the repository configuration file.

repoName (str)
  directory name containing the repository
withLargefiles (bool)
  flag indicating to configure the largefiles section
largefilesData (dict)
  dictionary with data for the largefiles section of the data dialog

#### Hg.hgEditUserConfig

hgEditUserConfig()

Public method used to edit the user configuration file.

#### Hg.hgExport

hgExport()

Public method to export patches to files.

#### Hg.hgExtendedDiff

hgExtendedDiff(name)

Public method used to view the difference of a file/directory to the Mercurial repository.

If name is a directory and is the project directory, all project files are saved first. If name is a file (or list of files), which is/are being edited and has unsaved modification, they can be saved or the operation may be aborted.

This method gives the chance to enter the revisions to be compared.

name (str)
  file/directory name to be diffed

#### Hg.hgGetBookmarksList

hgGetBookmarksList()

Public method to get the list of bookmarks.

Return:
  list of bookmarks

Return Type:
  list of str

#### Hg.hgGetBranchesList

hgGetBranchesList(withState=False, withDefault=False)

Public method to get the list of branches.

withState (bool (optional))
  flag indicating to include a state indication (defaults to False)
withDefault (bool (optional))
  flag indicating to include the 'default' branch, if that is present (defaults to False)

Return:
  list of branches with optional state indication ('' for an active branch, 'C' for a closed branch or 'I' for an inactive branch)

Return Type:
  list of str or list of tuple of (str, str)

#### Hg.hgGetCurrentBranch

hgGetCurrentBranch()

Public method to get the current branch of the working directory.

Return:
  name of the current branch

Return Type:
  str

#### Hg.hgGetTagsList

hgGetTagsList(withType=False)

Public method to get the list of tags.

withType (bool)
  flag indicating to get the tag type as well

Return:
  list of tags or list of tuples of tag name and flag indicating a local tag, if withType is True

Return Type:
  list of str or list of [(str, bool)]

#### Hg.hgGraft

hgGraft(revs=None)

Public method to copy changesets from another branch.

revs (list of str)
  list of revisions to show in the revisions pane

Return:
  flag indicating that the project should be reread

Return Type:
  bool

#### Hg.hgGraftAbort

hgGraftAbort()

Public method to abort an interrupted copying session and perform a rollback.

Return:
  flag indicating that the project should be reread

Return Type:
  bool

#### Hg.hgGraftContinue

hgGraftContinue()

Public method to continue copying changesets from another branch.

Return:
  flag indicating that the project should be reread

Return Type:
  bool

#### Hg.hgGraftStop

hgGraftStop()

Public method to stop an interrupted copying session.

Return:
  flag indicating that the project should be reread

Return Type:
  bool

#### Hg.hgIdentify

hgIdentify()

Public method to identify the current working directory.

#### Hg.hgImport

hgImport()

Public method to import a patch file.

Return:
  flag indicating, that the import contained an add, a delete or a change to the project file

Return Type:
  bool

#### Hg.hgIncoming

hgIncoming()

Public method used to view the log of incoming changes from the Mercurial repository.

#### Hg.hgInfo

hgInfo(mode="heads")

Public method to show information about the heads of the repository.

mode (str)
  mode of the operation (one of 'heads', 'parents', 'tip')

#### Hg.hgListBookmarks

hgListBookmarks()

Public method used to list the available bookmarks.

#### Hg.hgListTagBranch

hgListTagBranch(tags=True)

Public method used to list the available tags or branches.

tags (bool)
  flag indicating listing of branches or tags (False = branches, True = tags)

#### Hg.hgNormalizeURL

hgNormalizeURL(url)

Public method to normalize a url for Mercurial.

url (str)
  url string

Return:
  properly normalized url for mercurial

Return Type:
  str

#### Hg.hgOutgoing

hgOutgoing()

Public method used to view the log of outgoing changes from the Mercurial repository.

#### Hg.hgPhase

hgPhase(data=None)

Public method to change the phase of revisions.

data (tuple of (list of str, str, bool))
  tuple giving phase data (list of revisions, phase, flag indicating a forced operation)

Return:
  flag indicating success

Return Type:
  bool

Raises ValueError:
  raised to indicate an invalid phase

#### Hg.hgPreviewBundle

hgPreviewBundle()

Public method used to view the log of incoming changes from a changegroup file.

#### Hg.hgPull

hgPull(revisions=None, noupdate=False)

Public method used to pull changes from a remote Mercurial repository.

revisions (list of str (optional))
  list of revisions to be pulled (defaults to None)
noupdate (bool (optional))
  flag indicate to not update the working directory (defaults to False)

Return:
  flag indicating, that the update contained an add or delete

Return Type:
  bool

#### Hg.hgPush

hgPush(force=False, newBranch=False, rev=None)

Public method used to push changes to a remote Mercurial repository.

force (bool)
  flag indicating a forced push
newBranch (bool)
  flag indicating to push a new branch
rev (str)
  revision to be pushed (including all ancestors)

#### Hg.hgReMerge

hgReMerge(name)

Public method used to merge a URL/revision into the local project.

name (str)
  file/directory name to be merged

#### Hg.hgRecover

hgRecover()

Public method to recover an interrupted transaction.

#### Hg.hgRemoveSubrepositories

hgRemoveSubrepositories()

Public method to remove sub-repositories.

#### Hg.hgRollback

hgRollback()

Public method used to rollback the last transaction.

#### Hg.hgServe

hgServe(repoPath)

Public method used to serve the project.

repoPath (str)
  directory containing the repository

#### Hg.hgShowBranch

hgShowBranch()

Public method used to show the current branch of the working directory.

#### Hg.hgShowConfig

hgShowConfig()

Public method to show the combined configuration.

#### Hg.hgShowPaths

hgShowPaths()

Public method to show the path aliases for remote repositories.

#### Hg.hgSummary

hgSummary(mq=False, largefiles=False)

Public method used to show some summary information of the working directory state.

mq (bool)
  flag indicating to show the queue status as well
largefiles (bool)
  flag indicating to show the largefiles status as well

#### Hg.hgUnbundle

hgUnbundle(files=None)

Public method to apply changegroup files.

files (list of str)
  list of bundle files to be applied

Return:
  flag indicating, that the update contained an add or delete

Return Type:
  bool

#### Hg.hgVerify

hgVerify()

Public method to verify the integrity of the repository.

#### Hg.initCommand

initCommand(command)

Public method to initialize a command arguments list.

command (str)
  command name

Return:
  list of command options

Return Type:
  list of str

#### Hg.isExtensionActive

isExtensionActive(extensionName)

Public method to check, if an extension is active.

extensionName (str)
  name of the extension to check for

Return:
  flag indicating an active extension

Return Type:
  bool

#### Hg.stopClient

stopClient()

Public method to stop the command server client.

#### Hg.vcsAdd

vcsAdd(name, isDir=False, noDialog=False)

Public method used to add a file/directory to the Mercurial repository.

name (str)
  file/directory name to be added
isDir (bool)
  flag indicating name is a directory (unused)
noDialog (bool)
  flag indicating quiet operations

#### Hg.vcsAddBinary

vcsAddBinary(name, isDir=False)

Public method used to add a file/directory in binary mode to the Mercurial repository.

name (str)
  file/directory name to be added
isDir (bool)
  flag indicating name is a directory

#### Hg.vcsAddCommitMessage

vcsAddCommitMessage(message)

Public method to add a commit message to the list of saved messages.

message (str)
  message to be added

#### Hg.vcsAddTree

vcsAddTree(path)

Public method to add a directory tree rooted at path to the Mercurial repository.

path (str or list of str)
  root directory of the tree to be added

#### Hg.vcsAllRegisteredStates

vcsAllRegisteredStates(names, dname, shortcut=True)

Public method used to get the registered states of a number of files in the vcs.

Note: If a shortcut is to be taken, the code will only check, if the named directory has been scanned already. If so, it is assumed, that the states for all files have been populated by the previous run.

names (dict)
  dictionary with all filenames to be checked as keys
dname (str)
  directory to check in
shortcut (bool)
  flag indicating a shortcut should be taken (unused)

Return:
  the received dictionary completed with the VCS state or None in order to signal an error

Return Type:
  dict

#### Hg.vcsCheckout

vcsCheckout(vcsDataDict, projectDir, noDialog=False)

Public method used to check the project out of a Mercurial repository (clone).

vcsDataDict (dict)
  dictionary of data required for the checkout
projectDir (str)
  project directory to create
noDialog (bool)
  flag indicating quiet operations

Return:
  flag indicating an execution without errors

Return Type:
  bool

#### Hg.vcsCleanup

vcsCleanup(name)

Public method used to cleanup the working directory.

name (str)
  directory name to be cleaned up

#### Hg.vcsClearCommitMessages

vcsClearCommitMessages()

Public method to clear the list of saved messages.

#### Hg.vcsCommandLine

vcsCommandLine(name)

Public method used to execute arbitrary mercurial commands.

name (str)
  directory name of the working directory

#### Hg.vcsCommit

vcsCommit(name, message, noDialog=False, closeBranch=False, mq=False, merge=False)

Public method used to make the change of a file/directory permanent in the Mercurial repository.

name (str or list of str)
  file/directory name to be committed
message (str)
  message for this operation
noDialog (bool)
  flag indicating quiet operations
closeBranch (bool)
  flag indicating a close branch commit
mq (bool)
  flag indicating a queue commit
merge (bool)
  flag indicating a merge commit

#### Hg.vcsCommitMessages

vcsCommitMessages()

Public method to get the list of saved commit messages.

Return:
  list of saved commit messages

Return Type:
  list of str

#### Hg.vcsConvertProject

vcsConvertProject(vcsDataDict, project, addAll=True)

Public method to convert an uncontrolled project to a version controlled project.

vcsDataDict (dict)
  dictionary of data required for the conversion
project (Project)
  reference to the project object
addAll (bool)
  flag indicating to add all files to the repository

#### Hg.vcsDiff

vcsDiff(name)

Public method used to view the difference of a file/directory to the Mercurial repository.

If name is a directory and is the project directory, all project files are saved first. If name is a file (or list of files), which is/are being edited and has unsaved modification, they can be saved or the operation may be aborted.

name (str)
  file/directory name to be diffed

#### Hg.vcsExists

vcsExists()

Public method used to test for the presence of the hg executable.

Return:
  flag indicating the existence and an error message

Return Type:
  tuple of (bool, str)

#### Hg.vcsExport

vcsExport(vcsDataDict, projectDir)

Public method used to export a directory from the Mercurial repository.

vcsDataDict (dict)
  dictionary of data required for the checkout
projectDir (str)
  project directory to create

Return:
  flag indicating an execution without errors

Return Type:
  bool

#### Hg.vcsForget

vcsForget(name)

Public method used to remove a file from the Mercurial repository.

This will not remove the file from the project directory.

name (str or list of str)
  file/directory name to be removed

#### Hg.vcsGetProjectBrowserHelper

vcsGetProjectBrowserHelper(browser, project, isTranslationsBrowser=False)

Public method to instantiate a helper object for the different project browsers.

browser (ProjectBaseBrowser)
  reference to the project browser object
project (Project)
  reference to the project object
isTranslationsBrowser (bool)
  flag indicating, the helper is requested for the translations browser (this needs some special treatment)

Return:
  the project browser helper object

Return Type:
  HgProjectBrowserHelper

#### Hg.vcsGetProjectHelper

vcsGetProjectHelper(project)

Public method to instantiate a helper object for the project.

project (Project)
  reference to the project object

Return:
  the project helper object

Return Type:
  HgProjectHelper

#### Hg.vcsImport

vcsImport(vcsDataDict, projectDir, noDialog=False, addAll=True)

Public method used to import the project into the Mercurial repository.

vcsDataDict (dict)
  dictionary of data required for the import
projectDir (str)
  project directory
noDialog (bool)
  flag indicating quiet operations (unused)
addAll (bool)
  flag indicating to add all files to the repository

Return:
  tuple containing a flag indicating an execution without errors and a flag indicating the version controll status

Return Type:
  tuple of (bool, bool)

#### Hg.vcsInit

vcsInit(_vcsDir, noDialog=False)

Public method used to initialize the mercurial repository.

The initialization is done, when a project is converted into a Mercurial controlled project. Therefore we always return TRUE without doing anything.

_vcsDir (str)
  name of the VCS directory (unused)
noDialog (bool)
  flag indicating quiet operations (unused)

Return:
  always True

Return Type:
  bool

#### Hg.vcsInitConfig

vcsInitConfig(project)

Public method to initialize the VCS configuration.

This method ensures, that an ignore file exists.

project (Project)
  reference to the project

#### Hg.vcsLogBrowser

vcsLogBrowser(name=None, isFile=False)

Public method used to browse the log of a file/directory from the Mercurial repository.

name (str)
  file/directory name to show the log of
isFile (bool)
  flag indicating log for a file is to be shown

#### Hg.vcsMerge

vcsMerge(name, rev="")

Public method used to merge a URL/revision into the local project.

name (str)
  file/directory name to be merged (unused)
rev (str)
  revision to merge with

#### Hg.vcsMove

vcsMove(name, project, target=None, noDialog=False)

Public method used to move a file/directory.

name (str)
  file/directory name to be moved
project (Project)
  reference to the project object
target (str)
  new name of the file/directory
noDialog (bool)
  flag indicating quiet operations

Return:
  flag indicating successfull operation

Return Type:
  bool

#### Hg.vcsName

vcsName()

Public method returning the name of the vcs.

Return:
  always 'Mercurial'

Return Type:
  str

#### Hg.vcsNewProjectOptionsDialog

vcsNewProjectOptionsDialog(parent=None)

Public method to get a dialog to enter repository info for getting a new project.

parent (QWidget)
  parent widget

Return:
  reference to the instantiated options dialog

Return Type:
  HgNewProjectOptionsDialog

#### Hg.vcsOptionsDialog

vcsOptionsDialog(project, _archive, editable=False, parent=None)

Public method to get a dialog to enter repository info.

project (Project)
  reference to the project object
_archive (str)
  name of the project in the repository (unused)
editable (bool)
  flag indicating that the project name is editable (unused)
parent (QWidget)
  parent widget

Return:
  reference to the instantiated options dialog

Return Type:
  HgOptionsDialog

#### Hg.vcsRegisteredState

vcsRegisteredState(name)

Public method used to get the registered state of a file in the vcs.

name (str)
  file or directory name to check

Return:
  registered state

Return Type:
  VersionControlState

#### Hg.vcsRemove

vcsRemove(name, project=False, noDialog=False)

Public method used to remove a file/directory from the Mercurial repository.

The default operation is to remove the local copy as well.

name (str or list of str)
  file/directory name to be removed
project (bool)
  flag indicating deletion of a project tree (unused)
noDialog (bool)
  flag indicating quiet operations

Return:
  flag indicating successfull operation

Return Type:
  bool

#### Hg.vcsRepositoryInfos

vcsRepositoryInfos(_ppath)

Public method to retrieve information about the repository.

_ppath (str)
  local path to get the repository infos (unused)

Return:
  string with ready formated info for display

Return Type:
  str

#### Hg.vcsResolved

vcsResolved(name, unresolve=False)

Public method used to resolve conflicts of a file/directory.

name (str)
  file/directory name to be resolved
unresolve (bool)
  flag indicating to mark the file/directory as unresolved

#### Hg.vcsRevert

vcsRevert(name)

Public method used to revert changes made to a file/directory.

name (str)
  file/directory name to be reverted

Return:
  flag indicating, that the update contained an add or delete

Return Type:
  bool

#### Hg.vcsSbsDiff

vcsSbsDiff(name, extended=False, revisions=None)

Public method used to view the difference of a file to the Mercurial repository side-by-side.

name (str)
  file name to be diffed
extended (bool)
  flag indicating the extended variant
revisions (tuple of (str, str))
  tuple of two revisions

Raises ValueError:
  raised to indicate an invalid name parameter

#### Hg.vcsShutdown

vcsShutdown()

Public method used to shutdown the Mercurial interface.

#### Hg.vcsStatus

vcsStatus(name)

Public method used to view the status of files/directories in the Mercurial repository.

name (str or list of str)
  file/directory name(s) to show the status of

#### Hg.vcsSupportCommandOptions

vcsSupportCommandOptions()

Public method to signal the support of user settable command options.

Return:
  flag indicating the support of user settable command options

Return Type:
  bool

#### Hg.vcsSwitch

vcsSwitch(name)

Public method used to switch a working directory to a different revision.

name (str)
  directory name to be switched

Return:
  flag indicating, that the switch contained an add or delete

Return Type:
  bool

#### Hg.vcsTag

vcsTag(name=None, revision=None, tagName=None)

Public method used to set/remove a tag in the Mercurial repository.

name (str)
  file/directory name to determine the repo root from (unused)
revision (str)
  revision to set tag for
tagName (str)
  name of the tag

Return:
  flag indicating a performed tag action

Return Type:
  bool

#### Hg.vcsUpdate

vcsUpdate(name=None, noDialog=False, revision=None)

Public method used to update a file/directory with the Mercurial repository.

name (str)
  file/directory name to be updated (unused)
noDialog (bool)
  flag indicating quiet operations
revision (str)
  revision to update to

Return:
  flag indicating, that the update contained an add or delete

Return Type:
  bool

Up